import { connect } from 'react-redux';
import { push } from 'react-router-redux';
import Welcome from '../components/welcome/Welcome';
import { clear } from '../actions/CalcRiskAction';
import { agree } from '../actions/ConsentAction'
import { calcRiskAll } from '../actions/CalcRiskAction';

const states = {
  age: 55,
  alcoholAmountBeer: 8,
  alcoholFrequency: 3,
  alcoholHabit: 1,
  antihypertensiveFlg: 0,
  bloodSugarLevelFasting: 2,
  bodyHeight: 135,
  bodyWeight: 44,
  chronicGastritisFlg: 0,
  diabetesCureFlg: 0,
  exerciseTimeLaboring: 1,
  exerciseTimeSitting: 1,
  exerciseTimeStanding: 1,
  familyAnamnesisFlg: 0,
  gender: 2,
  hdlCholesterol: 21,
  helicobacterPyloriFlg: 0,
  ldlCholesterol: 26,
  maxBloodPressure: 87,
  minBloodPressure: 46,
  salineFood: 2,
  smokingHabit: 2,
  triglyceride: 27
}
const mapDispatchToProps = (dispatch) => ({
  onAction: () => {

    dispatch(clear());
    dispatch(agree());
    dispatch(calcRiskAll(states, 0));
    // dispatch(push('/report'));
    dispatch(push('/input'));
  },
});

export default connect(null, mapDispatchToProps)(Welcome)
